package yangyongchao.com.mymvpdome;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements HomeView {
    private String TAG = getClass().getName();
    private TextView mTextView1;
    private TextView mTextView2;
    private EditText mEditText;
    private HomePresenter mPresenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mTextView1 = findViewById(R.id.text1);
        mTextView2 = findViewById(R.id.text2);
        mEditText = findViewById(R.id.edit);
        mPresenter = new HomePresenter(this);
    }

    @Override
    public void showData(String input) {
        Log.d(TAG, "showData: "+input);
    }

    public void dataTotvone(View view) {
        mPresenter.dataToView(mEditText,mTextView1);
    }

    public void dataTotvtow(View view) {
        mPresenter.dataToView(mEditText,mTextView2);
    }
}
